﻿Public Class Login
    Inherits System.Web.UI.Page
    Dim objUser As New LoginHelper("", "")
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

  
    Protected Sub login_click(ByVal sender As Object, ByVal e As EventArgs) Handles bt_dangnhap.Click
        objUser = New LoginHelper(txt_taikhoan.Text.Trim(), txt_matkhau.Text.Trim())
        If objUser.IsLoged Then
            If objUser.IsAdmin = True Then
                Session("sesLoginAdmin") = objUser
                Response.Redirect("AdminDefault.aspx")
            Else
                Session("sesLoginUser") = objUser
                Response.Redirect("Default.aspx")

            End If
        Else
            lb_loi.Text = objUser.Message
        End If
    End Sub
End Class